<%--
  Created by IntelliJ IDEA.
  User: wyp
  Date: 2020/5/9
  Time: 11:25
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="UTF-8">
    <!-- Tell the browser to be responsive to screen width -->
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Font Awesome  src\main\webapp\resources\plugins\fontawesome-free\css\all.min.css-->
    <link rel="stylesheet" href="./resources/plugins/fontawesome-free/css/all.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- icheck bootstrap -->
    <link rel="stylesheet" href="./resources/plugins/icheck-bootstrap/icheck-bootstrap.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="./resources/dist/css/adminlte.min.css">
    <!-- Google Font: Source Sans Pro -->
    <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,400i,700" rel="stylesheet">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>忘记密码</title>
</head>
<script type="text/javascript">
    function changeImg() {
        document.getElementById("capImg").src = document.getElementById("capImg").src+"?"+Math.random();
        //由于浏览器缓存，src一样的话，浏览器不刷新，所以在图片后面添加 随机数，即可解决刷新问题
    }

    //验证密码是否一致，输入框是否有空
    function check(){

        if(form1.userName.value===""){
            alert("用户名不允许为空!");
            form1.userName.focus();
            return false;
        }


        if(form1.passWord.value==""){
            alert("密码不允许为空!");
            form1.passWord.focus();
            return false;
        }


        if(form1.passWord.value!=form1.passWord2.value){
            alert("两次输入密码不一致，请重新输入!");
            form1.passWord2.focus();
            return false;
        }


        var re = /^1\d{10}$/ ;//表达式
        if(!re.test(form1.telphone.value)){
            alert("手机号码格式不正确，请重新输入11位手机号!");
            form1.telphone.focus();
            return false;
        }

        if(form1.inputCapche.value==""){
            alert("验证码未输入!");
            form1.inputCapche.focus();
            return false;
        }

    }
</script>

<body class="hold-transition login-page" style="background-image: url('./img/back/loginbackimg.jpg');background-size: 100%;">
<!--头部文件-->

<div class="login-box">
    <div class="login-logo">
        <a href="./index.jsp"><b>闽院</b>小新旅游</a>
    </div>
    <!-- /.login-logo -->
    <div class="card">
        <div class="card-body login-card-body">
            <p class="login-box-msg">找回密码</p>

            <form action="./findUser" method="post" onsubmit="return check()" id="form1">
                <div class="input-group mb-3">
                    <input type="text" class="form-control" id="userName" name="userName" placeholder="用户名">
                    <div class="input-group-append">
                        <div class="input-group-text">
                            <span class="fas fa-user"></span>
                        </div>
                    </div>
                </div>
                <div class="input-group mb-3">
                    <input type="password" class="form-control" id="passWord" name="passWord" placeholder="密码">
                    <div class="input-group-append">
                        <div class="input-group-text">
                            <span class="fas fa-lock"></span>
                        </div>
                    </div>
                </div>

                <div class="input-group mb-3">
                    <input type="password" class="form-control" id="passWord2" name="passWord2" placeholder="再次输入密码">
                    <div class="input-group-append">
                        <div class="input-group-text">
                            <span class="fas fa-lock"></span>
                        </div>
                    </div>
                </div>

                <div class="input-group mb-3">
                    <input type="text" class="form-control" id="telphone" name="telphone" placeholder="验证手机">
                    <div class="input-group-append">
                        <div class="input-group-text">
                            <span class="fas fa-phone-square"></span>
                        </div>
                    </div>
                </div>


                <div class="input-group mb-3">
                    <input type="text" class="form-control" id="inputCapche" name="inputCapche" placeholder="验证码">
                    <img src="./captche" id="capImg" name="capImg" onclick="changeImg()">

                </div>

                <div class="row" style="">

                    <!-- /.col -->
                    <div class="col-12" >
                        <button type="submit" class="btn btn-primary btn-block" >更改密码</button>
                    </div>
                    <!-- /.col -->
                </div>
            </form>


            <!-- /.social-auth-links -->

            <p class="mb-1">

                <a href="./register">立即注册</a>

                <a href="./login" class="text-center" style="float: right;">立即登陆</a>
            </p>
        </div>
        <!-- /.login-card-body -->
    </div>
</div>
</body>

<!-- jQuery -->
<script src="./resources/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="./resources/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="./resources/dist/js/adminlte.min.js"></script>


</html>
